<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/7/22
  Time: 13:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <%@include file="../../../../resources/inc/head.jsp" %>
</head>
<body>

<div class="layui-fluid">
    <expect-x:tip tipMessage="标识“*”的选项为必填项，其余为选填项。;请按提示信息填写每一个字段"/>

    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto option-ba">
            <div class="layui-collapse ">
                <div class="layui-colla-item">
                    <h2 class="layui-colla-title">展开搜索</h2>
                    <div class="layui-colla-content">
                        <div class="layui-form-item">
                            <div class="layui-inline">
<%--                                <label class="layui-form-label">请求方式</label>--%>
                                <expect-x:dictSelect field="requestType" verify="false" typeGroupCode="method_type" />
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-block">
                                    <input type="text" name="userName" placeholder="请输入用户名" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button  class="layui-btn" lay-submit lay-filter="Type-serch">
                                    搜索
                                </button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </div>

        <div class="layui-card-body">
            <table id="systemLog" lay-filter="systemLog"></table>
            <script type="text/html" id="optionToolbar">
                <div class="layui-btn-container">
                    <shiro:hasPermission name="Expect-X:system:log:create"><button class="layui-btn layui-btn-sm" lay-event="add">新增  </button></shiro:hasPermission>
                    <shiro:hasPermission name="Expect-X:system:log:delete"><button class="layui-btn layui-btn-danger layui-btn-sm" lay-event="dels"id="dels">批量删除</button></shiro:hasPermission>

                </div>
            </script>
            <script type="text/html" id="optionBar">
                <shiro:hasPermission name="Expect-X:system:log:update"> <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a></shiro:hasPermission>
                <shiro:hasPermission name="Expect-X:system:log:delete"><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></shiro:hasPermission>
            </script>
            <script type="text/html" id="gmtStartTime">
                {{#
                var date = new Date();
                date.setTime(d.gmtModified);
                return date.Format("yyyy-MM-dd hh:mm:ss");
                }}
            </script>
       
        </div>
    </div>
</div>

<%@include file="../../../../resources/inc/footer.jsp" %>
<script>
    layui.config({
        base: '<%=basePath%>resources/lib/layuiAdmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'table'], function () {
        var $ = layui.$
            , form = layui.form
            , table = layui.table;
        table.render({
            elem: '#systemLog',
            url: '<%=basePath%>manager/system/systemLog/page.html',
            cols: [[
                {type: 'checkbox',fixed:'left'},
                {field: 'id', width: 60, title: 'ID', sort: true}
                , {field: 'userName', title: '用户名'}
                ,{field: 'description',  title: '操作'}
                , {field: 'requestType', title: '请求方式'}
                , {field: 'spendTime', title: '耗费时间'}
                , {field: 'uri', title: '路径'}
                , {field: 'ip', title: 'IP地址'}
                , {field: 'startTime', title: '操作时间', sort: true, templet: "#gmtStartTime"}

            ]],
            page: !0,
            limit: 10,
            height: "full-130",
            text: {none:"暂无可显示数据"},
            response: {
                statusCode: 200
            }
        });


        //监听搜索
        form.on('submit(Type-serch)', function (data) {
            var field = data.field;
            field.page=1;
            table.reload('systemLog', {
                where: field
            });
        });


    });
    function edit(e) {

    }

</script>
</body>
</html>

